<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="b" uri="/bbs-tags"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<base href="<%=basePath%>">

		<title>My JSP 'blogIndex.jsp' starting page</title>

		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
		<meta http-equiv="description" content="This is my page">

		<link rel="stylesheet" type="text/css" href="css/blog_header.css">
		<link rel="stylesheet" type="text/css" href="css/blog_top_head.css">
		<link rel="stylesheet" type="text/css" href="css/blogIndex.css">
		<link rel="stylesheet" type="text/css" href="css/footer.css">
		<script type="text/javascript" src="js/parseIcon.js">
</script>
		<script type="text/javascript" src="js/jquery.js">
</script>
		<script type="text/javascript" src="/BBSPro/dwr/engine.js">
</script>
		<script type="text/javascript" src="/BBSPro/dwr/util.js">
</script>
		<script type="text/javascript"
			src="/BBSPro/dwr/interface/messageBoardServiceImpl.js">
</script>
		<script type="text/javascript">
function init() {
	var uid = dwr.util.getValue("messageBox_userId");

	messageBoardServiceImpl
			.lookMessageBoardDetail(
					uid,
					function(date) {
						var len = 0;
						if (date.length <= 6) {
							len = date.length;
						}
						if (date.length > 6) {
							len = 6;
						}
						for ( var i = 0; i < len; i++) {
							var id = date[date.length - i - 1].messageBoardId;
							dwr.util.cloneNode("message_1", {
								idSuffix : id
							});
							dwr.util
									.setValue(
											"message_4" + id,
											date[date.length - i - 1].messageBoardContent);
							dwr.util.setValue("message_3" + id,
									date[date.length - i - 1].user.userName)
							dwr.util.byId("message_3" + id).href = "lookBlogIndexAction?userId="
									+ date[date.length - i - 1].user.userId;
							dwr.util.byId("message_1" + id).style.display = "inline";
							dwr.util.byId("message_2" + id).src = "files/"
									+ date[date.length - i - 1].user.userInfo.images;
						}
					});
	parseIcon();

}
function publishMessage() {
	var u_name = dwr.util.getValue("u_name");
	var uid = dwr.util.getValue("messageBox_userId");
	var messageContent = dwr.util.getValue("postContent");
	messageBoardServiceImpl.publishMessageBoard(u_name, uid, messageContent,
			function(date) {
				init();
			});
	dwr.util.setValue("postContent", "");

}
</script>
	</head>

	<body onload="init()">
		<div id="content">
			<div class="tbody">
				<%@ include file="styleJsp/blog_top_head.jsp"%>
				<div class="table">
					<%@include file="styleJsp/blog_header.jsp"%>
					<div class="center">
						<div class="center_left">
							<div class="center_left_personInfo">
								<div class="center_left_personInfo_title">
									<a href="#">个人资料</a>
								</div>

								<div class="center_left_personInfo_context">
									<div class="center_left_personInfo_contextImg">
										<div class="center_left_personInfo_contextImgStyle">
											<img src="files/<s:property value='user.userInfo.images'/>" style="width: 119; height: 119" />
										</div>
									</div>
									<div class="center_left_personInfo_contextName">
										ID:&nbsp;${param.userId} &nbsp;${friendsMessage}
									</div>
									<div class="center_left_personInfo_contextContext">
										<div class="center_left_personInfo_contextContext1">
											<img src="images/zbkj.jpg" />
											<a href="addFriendsAction?toUserId=${param.userId}">加为好友</a>
											<img src="images/ckly.jpg" />
											<a href="#">查看留言</a>
										</div>
										<div class="center_left_personInfo_contextContext2">
											<img src="images/bjtx.jpg" />
											<a href="#">编辑头像</a>
											<img src="images/gxzl.jpg" />
											<a href="#">更新资料</a>
										</div>
									</div>
								</div>
							</div>

							<div class="center_left_photo">
								<div class="center_left_photo_title">
									<a href="#">相册</a>
								</div>
								<div class="center_left_photo_context">
									<!--  相册迭代 -->
									<s:iterator value="user.albums">
										<div class="center_left_photo_context1">
											<span class="center_left_photo_context1-1"> <a
												href="lookAlbumAction_lookAlbumDetail?albumId=<s:property value='albumId'/>&userId=${param.userId}"><img
														src="images/album_face.gif"
														style="border: solid 1px #CCC;" width="48" height="48" />
											</a> </span>
											<span class="center_left_photo_context1-2"><a href="#"><s:property
														value="albumName" /> </a> </span>
										</div>
									</s:iterator>
								</div>
							</div>

							<div class="center_left_record">
								<div class="center_left_record_title">
									<a href="#">记录</a>
								</div>
								<div class="center_left_record_context">
									<!-- 记录迭代 -->
									<s:iterator value="user.say">
										<s:if test="say==null">
											<div class="center_left_record_context1">
												<span class="center_left_record_context1-1"> <a
													href="#"><s:property value="sayContent" /> </a> </span>
												<div class="center_left_record_context1-2">
													<span class="center_left_record_context1-2-1"> <s:property
															value="sayDate.toString().substring(0,16)" /> </span>
													<span class="center_left_record_context1-2-2"><a
														href="#">回复</a> </span>
												</div>
											</div>
										</s:if>
									</s:iterator>
								</div>
							</div>
						</div>
						<div class="center_center">

							<div class="center_center_dynamic">
								<div class="center_center_dynamic_title">
									<a href="#">动态</a>
								</div>
								<div class="center_center_dynamic_context"></div>
							</div>

							<div class="center_center_share">
								<div class="center_center_share_title">
									<a href="#">分享</a>
								</div>
								<div class="center_center_share_context">
									<!-- 分享迭代 -->
									<s:iterator value="user.shares">
										<div class="center_center_share_context1">
											<div class="center_center_share_context1-1">
												<span><a
													href="lookShareAction_lookShareDetails?shareId=<s:property value='shareId'/>&userId=${param.userId}">分享了一篇日志</a>
												</span>
												<span>-</span>
												<span><s:property
														value="shareTime.toString().substring(0,16)" /> </span>
											</div>
											<div class="center_center_share_context1-2">
												<span><a
													href="lookBlogIndexAction?userId=<s:property value='diary.user.userId'/>"><s:property
															value="diary.user.userName" /> </a> </span>
												<span>的</span>
												<span><a
													href="lookDiaryAction_lookDiaryDetails?diaryId=<s:property value='diary.diaryId' />&pageNo=1&userId=<s:property value='diary.user.userId' />"><s:property
															value="diary.diaryName" /> </a> </span>
											</div>
										</div>
									</s:iterator>
								</div>
							</div>

							<div class="center_center_diary">
								<div class="center_center_diary_title">
									<a href="#">日志</a>
								</div>
								<div class="center_center_diary_context">
									<!-- 日志迭代 -->
									<s:iterator value="user.diarys">
										<s:if test="%{diary==null}">
											<div class="center_center_diary_context1">
												<div class="center_center_diary_context1-1">
													<span><a
														href="lookDiaryAction_lookDiaryDetails?diaryId=<s:property value='diaryId' />&pageNo=1&userId=${userId}"><s:property
																value="diaryName" /> </a> </span>
												</div>
												<div class="center_center_diary_context1-2">
													<span><s:property value="diaryContent" /> </span>
												</div>
												<div class="center_center_diary_context1-3">
													<span>(<s:property value="diaryClick" />)次阅读</span>
													<span>|</span>
													<span>(<s:property value="diaryReply" />)次评论</span>
													<span>|</span>
													<span>(<s:property value="DiaryShareCount" />)次分享</span>
												</div>
											</div>
										</s:if>
									</s:iterator>
								</div>
							</div>

							<div class="center_center_line"></div>

							<div class="center_center_messageBoard">
								<div class="center_center_messageBoard_title">
									<span class="lmessage"><a href="#">留言</a> </span>
									<span class="total"><a href="#">全部</a> </span>
								</div>
								<div id="content">
									<div class="center_center_messageBoard_context">
										<div class="center_center_messageBoard_context1">
											<input type="hidden" name="messageBox_userId"
												value="<s:property value='userId'/>" />
											<input type="hidden" name="u_name"
												value="<s:property value='%{#session.user.userName}'/>" />
											<b:editTable height="100" width="438" />
											<span class="submitType"><s:submit type="image"
													src="images/smallMessageBoard.jpg"
													onclick="publishMessage()" cssClass="fabuImg" /> </span>
										</div>
										<!-- 留言内容 -->
										<!-- 留言迭代 -->

										<div class="center_center_messageBoard_context2"
											id="message_1" style="display: none;">
											<div class="line1"></div>
											<div class="messageBoard_context2_text">
												<div class="imgType">
													<div class="img">
														<img src="" style="width: 40; height: 40" id="message_2" />
													</div>
												</div>
												<div class="messageBoard_context2_textType">
													<div class="messageBoard_context2_textType1">
														<span class="username"><a href="#" id="message_3"></a>
														</span>
														</span>
													</div>
													<div class="messageBoard_context2_textType2">
														<span class="messageBoard_context2_textType2Text"
															id="message_4"></span>
													</div>
												</div>
											</div>
											<!-- 回复
										<div class="messageBoard_context2_text_r" id="message_1_1"
											style="display: none;">
											<div class="imgType">
												<div class="img">
													<img src="" style="width: 40; height: 40" id="message_2_1" />
												</div>
											</div>
											<div class="messageBoard_context2_textType_r">
												<div class="messageBoard_context2_textType1_r">
													<span class="username"><a href="#" id="message_3_1"></a>
													</span>
													<span class="caozuo"><a href="#" id="m_edit1">回复</a>&nbsp;&nbsp;<a
														href="#" id="m_dele2">删除</a> </span>
												</div>
												<div class="messageBoard_context2_textType2_r">
													<span class="messageBoard_context2_textType2Text_r"
														id="message_4_1"></span>
												</div>
											</div>
										</div> -->
										</div>

										<div class="center_center_messageBoard_context3">
											<div class="line3Type"></div>
											<div class="word3">
												<span class="word3Type"><a href="#">查看全部</a> </span>
											</div>
										</div>
									</div>
								</div>
							</div>

						</div>
						<div class="center_right">
							<div class="center_right_friends">
								<div class="center_right_friends_title">
									<a href="#">好友</a>
								</div>
								<div class="center_right_friends_context">
									<!-- 好友迭代 -->
									<s:iterator value="user.friends">
										<div class="center_right_friends_context1">
											<span class="center_right_friends_context1-1"> <a
												href="lookBlogIndexAction?userId=<s:property value='toUser.userId' />"><img
														src="images/people_small.gif" style="border: 0;" /> </a> </span>
											<span class="center_right_friends_context1-2"><a
												href="lookBlogIndexAction?userId=<s:property value='toUser.userId' />"><s:property
														value="toUser.userName" /> </a> </span>
										</div>
									</s:iterator>
								</div>
							</div>

							<div class="center_right_visitor">
								<div class="center_right_visitor_title">
									<a href="#">最近访客</a>
								</div>
								<div class="center_right_visitor_context">
									<!-- 访客迭代 -->
									<s:iterator value="toVisitor">
										<div class="center_right_visitor_context1">
											<span class="center_right_visitor_context1-1"> <a
												href="#"><img src="images/people_small.gif"
														style="border: 0;" /> </a> </span>
											<span class="center_right_visitor_context1-2"><a
												href="#"><s:property value="user.userName" /> </a> </span>
										</div>
									</s:iterator>
								</div>
							</div>
						</div>

					</div>
				</div>
				<%@ include file="styleJsp/footer.jsp"%>
			</div>
		</div>
	</body>
</html>
